package cn.school.job.evaluation;

import cn.school.teacher.evaluation.service.TeacherEvaluationResultService;
import lombok.extern.slf4j.Slf4j;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.quartz.QuartzJobBean;

import java.util.Calendar;

@Slf4j
/**
 * 考核结果生成任务
 * */
public class EvaluationResultProcessJob extends QuartzJobBean {
    private static Logger logger = LoggerFactory.getLogger(EvaluationResultProcessJob.class);
    
    @Autowired
    private TeacherEvaluationResultService teacherEvaluationResultService;

    @Override
    protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        try {
            logger.info("EvaluationResultProcessJob" + Calendar.getInstance().getTime().getTime());
            teacherEvaluationResultService.processBiz();
        } catch (Exception e) {
            logger.error("", e);
        }
    }
}
